﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RecieverSelect.aspx.cs"
    Inherits="HZ.DrugTrade.Web.Hospitals.MessageMange.RecieverSelect" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>收件人选择</title>
    <link rel="stylesheet" type="text/css" href="../../lib/style/global.css" />

    <script type="text/javascript" src="../../lib/scripts/Common.js"></script>

    <script type="text/javascript" src="../../lib/scripts/global.js"></script>

    <script type="text/javascript" src="../../lib/scripts/jquery.js"></script>

    <script type="text/javascript" src="../../lib/scripts/mainlistSelect.js"></script>

    <script type="text/javascript" language="javascript">
    
            function addCompanyInfo() 
            {
//                 if (!checkSelectedItems('gvwCompany', '请至少选择一项！')) 
//                 {
//                     return false;
//                 }
//                 if(!checkSelectedItems('gvwHospital', '请至少选择一项！'))
//                 { 
//                      return false;
//                 }
            
                 CheckBoxList = document.getElementsByName("chkCompany");
                 var resultValue = "", nameList = "", idList = "";

                 for (var i = 0; i < CheckBoxList.length; i++) 
                 {
                    if (CheckBoxList[i].checked) 
                    {
                       resultValue = CheckBoxList[i].value;
                       tempId = resultValue.split("|")[0];
                       tempName = resultValue.split("|")[1];

                       idList = idList + tempId + ",";
                       nameList = nameList + tempName + ",";
                    }
                  }

                var CompanyInfo;
                CompanyInfo = nameList + "|" + idList;
                opener.insertCompanyInfo(CompanyInfo);
                window.close();
             }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div class="listctrl" style="text-align: left">
        <table>
            <tr>
                <td>
                    <asp:Label ID="lblName" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="btnSearch" runat="server" Text="查询" CssClass="btn" 
                        onclick="btnSearch_Click" />
                </td>
            </tr>
        </table>
    </div>
    <div style="text-align: left">
        <asp:GridView ID="gvwCompany" runat="server" AutoGenerateColumns="false" EmptyDataText="暂无符合条件的数据！"
            Width="100%" CssClass="mainlist">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="chkAllCompany" name="chkAll" type="checkbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input id="chkCompany" name="chkCompany" type="checkbox" value='<%# Eval("CompanyID") %>|<%# Eval("CompanyName") %>'>
                        </input>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="企业名称">
                    <ItemTemplate>
                        <%# Eval("CompanyName") %>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:GridView ID="gvwHospital" runat="server" AutoGenerateColumns="false" EmptyDataText="暂无符合条件的数据！"
            Width="100%" CssClass="mainlist">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="chkAllCompany" name="chkAll" type="checkbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input id="chkCompany" name="chkCompany" type="checkbox" value='<%# Eval("HospitalID") %>|<%# Eval("HospitalName") %>'>
                        </input>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="医疗机构名称">
                    <ItemTemplate>
                        <%# Eval("HospitalName") %>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:GridView ID="gvwManageOrg" runat="server" AutoGenerateColumns="false" EmptyDataText="暂无符合条件的数据！"
            Width="100%" CssClass="mainlist">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="chkAllCompany" name="chkAll" type="checkbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input id="chkCompany" name="chkCompany" type="checkbox" value='<%# Eval("ManageOrgID") %>|<%# Eval("ManageOrgName") %>'>
                        </input>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="机构名称">
                    <ItemTemplate>
                        <%# Eval("ManageOrgName") %>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:GridView ID="gvwRole" runat="server" AutoGenerateColumns="false" EmptyDataText="暂无符合条件的数据！"
            Width="100%" CssClass="mainlist">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <input id="chkAllCompany" name="chkAll" type="checkbox" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <input id="chkCompany" name="chkCompany" type="checkbox" value='<%# Eval("RoleID") %>|<%# Eval("RoleName") %>'>
                        </input>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="角色名称">
                    <ItemTemplate>
                        <%# Eval("RoleName") %>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_OnPageChanged">
        </webdiyer:AspNetPager>
    </div>
    <br />
    <div class="listctrl" style="text-align: left">
        <input id="btnConfirm" type="button" value="确定选择" onclick="javascript:addCompanyInfo();"
            class="btn" />
        <input id="Button1" type="button" onclick="openner=null;window.close();" value="取消"
            class="btn" /></div>
    </form>
</body>
</html>
